// 酒馆长积分结算
import http from '@/utils/request'
import { base } from '@/config'

const integralSettlementApi = {
  //积分结算-数据概况-积分走势图
  getIntegralTrend: params => {
    return http.get(`${base.finance}/platformStatistics/getLine`, { params })
  },
  // 积分结算-数据概况-统计数据
  getIntegralStatistics: params => {
    return http.get(`${base.finance}/platformStatistics/overview`, { params })
  },
  //积分结算-平台积分核算-核算列表
  getIntegralSettlementList: params => {
    return http.get(`${base.finance}/platformStatistics/getAmountSettleList`, { params })
  },
  //积分结算-平台积分核算-核算列表tab统计
  getIntegralSettlementTabs: () => {
    return http.get(`${base.finance}/platformStatistics/getAmountSettleTab`)
  },

  //获取积分列表
  getIntegralList: params => {
    return http.get(`${base.finance}/platformStatistics/getDetailList`, { params })
  },
  //获取积分列表tab统计
  getIntegralTabs: params => {
    return http.get(`${base.finance}/platformStatistics/getDetailTotal`, { params })
  },
  //积分结算对账单-单个统计
  getSettlementBillStatistics: settleId => {
    return http.get(`${base.finance}/platformStatistics/getAmountSettleTotal/${settleId}`, {
      params: { settleId }
    })
  },

  //积分结算对账单-对账单详情
  getSettlementBillDetail: settleId => {
    return http.get(`${base.finance}/platformStatistics/getAmountSettleDetail/${settleId}`, {
      params: { settleId }
    })
  },
  //积分结算对账单-完成结算
  auditIntegralSettlementBill: params => {
    return http.postJson(`${base.finance}/platformStatistics/amountSuccess`, params)
  },

  //根据包订单号查询订单号
  getPackOrderNos: orderNo => {
    return http.get(`${base.order}/orderManager/getPackOrderNos/${orderNo}`, { orderNo })
  },

  //根据退款支付单号查询订单号
  getRefundOrder: payNo => {
    return http.get(`${base.order}/orderManager/getRefundOrder/${payNo}`, { payNo })
  }
}

export default integralSettlementApi
